<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>{{ page_title }}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="icon" type="image/png" href="/images/favicon.png"/>
    <link rel="stylesheet" href="/style/structure.css" media="all" />
    <link rel="stylesheet" href="/style/theme.css" media="all" />
	<style type="text/css" media="all">
	</style>
    <link rel="stylesheet" href="/style/ui.all.css" media="all" />
    <script type="text/javascript" src="/scripts/jquery.js"></script>
    <script type="text/javascript" src="/scripts/form.js"></script>
    <script type="text/javascript">
$(document).ready(function() {
    $('.primary-navigation-more').hover(function(e){$(this).children('.primary-navigation-more-link').addClass('hover');$(this).children('ul').show();},function(e){$(this).children('.primary-navigation-more-link').removeClass('hover');$(this).children('ul').hide();});
});
    </script>

<!-- Add in tracker code here (i.e. Google Analytics) -->
  </head>
<body>
<div id="page">
    <div id="masthead">
        <h1 id="logo"><a href="/"><img id="logo-image" src="/images/mainlogo.png" alt="{{ sitetitle }}" /></a></h1>

        <div id="leaderboard-ad">
        <!-- leaderboard ad code or leaderboard image goes here -->
        <a href="/"><img id="banner-image" src="/images/banner.png" alt="{{ sitetitle }}" /></a>

        </div>
    </div>

    <div id="navigation">
          <ul id="primary-navigation">
              <li><a href="/">Home</a></li>
              <li class="primary-navigation-more">
                  <a class="primary-navigation-more-link" href="#">Articles</a>
                  <ul>
                    {% for navcategory in navcategories %}
                    <li><a href="/articlecategory?category={{ navcategory }}">{{ navcategory }}</a></li>
                    {% endfor %}
                  </ul>
              </li>
              {% if showdocuments %}
              <li class="primary-navigation-more">
                  <a class="primary-navigation-more-link" href="#">Documents</a>
                  <ul>
                    {% for navdoccategory in navdoccategories %}
                    <li><a href="/documentcategory?category={{ navdoccategory }}">{{ navdoccategory }}</a></li>
                    {% endfor %}
                  </ul>
              </li>
              {% endif %}
              {% if showdiscussions %}
              <li class="primary-navigation-more">
                  <a class="primary-navigation-more-link" href="#">Discussions</a>
                  <ul>
                    {% for navdiscussiontype in navdiscussiontypes %}
                    <li><a href="/discussion?type={{ navdiscussiontype }}">{{ navdiscussiontype }}</a></li>
                    {% endfor %}
                  </ul>
              </li>
              {% endif %}
              {% if shownewsletter %}
              <li><a href="/newsletter">Newsletter</a></li>
              {% endif %}
              <li><a href="/about">About</a></li>
            </ul>
    </div>
    <div id="main">
        <div id="content">
            {% block content %}{% endblock %}
        </div>

        <div id="sidebar">
            <div id="sidebar-logo">
            <a href="/"><img src="/images/sidebarlogo.png"></a>
                <p>
            </div>
            {% if not nickname %}
            <div id="sidebar-logo">
            <p>
            <a href="/register"><img src="/images/becomeamember.png"></a>
            </div>
            {% endif %}

            {% if showmembership %}
            <div id="sponsored-resources" class="with-divider">

                {% if username %}
                    {% if nickname %}
                        <h2 id="sponsored-resources-title">{{ sitetitleshort }} Member: {{nickname}}</h2>
                    {% else %}
                        <h2 id="sponsored-resources-title">Google user: {{username}}</h2>
                    {% endif %}
                {% else %}
                    <h2 id="sponsored-resources-title">{{ sitetitleshort }} Member: Not signed in</h2>
                {% endif %}
                <div id="sponsored-resources-content">
                    {% if username %}
                        {% if nickname %}
                            <p>Member since:  {{ datejoined|date:"D, F d Y" }}</p>
                            <p>Comments posted: {{ commentcount }}</p>
                            <p>Subscriber: <a href="/newsletter">{% if subscriber %}Yes{% else %}No{% endif %}</a></p>
                            <p><a href="{{ logouturl }}">Sign out</a></p>
                        {% else %}
                            <p>You are signed in with your Google account, but not registered as a {{ sitetitleshort }} Member.  As a Member you will be able to join discussions, comment on articles and receive updates.  <a href="/register">Click here to register.</a></p>
                            <p><a href="{{ logouturl }}">Sign out</a></p>
                        {% endif %}
                    {% else %}
                        <p><a href="{{ loginurl }}">Sign in to {{ sitetitle }}.</a><i>  ({{ sitetitleshort }} uses <a href="https://www.google.com/accounts/NewAccount?">Google Accounts</a> for Sign In).</i></p>
                    {% endif %}
                    {% if is_admin %}
                        <p><a href="/adminarticle">Article Admin</a></p>
                        <p><a href="/admindocument">Document Admin</a></p>
                        <p><a href="/admindiscussion">Discussion Admin</a></p>
                        <p><a href="/adminprofile">User Profile Admin</a></p>
                        <p><a href="/adminmessage">Subscriber Message</a></p>
                    {% endif %}
                </div>
            </div>
            {% endif %}

            <div class="sidebar-box">
                <br>
                <div class="sidebar-ad">
<!-- sidebar ad code goes here  -->
                </div>
            </div>

            {% if shownewsletter %}
            <div id="sidebar-logo">
            <p>
            <a href="/newsletter"><img src="/images/newsletter.png"></a>
            </div>
            {% endif %}


            {% if showdiscussions %}
            <div class="sidebar-box">
                <h2 class="sidebar-title">Join the Discussion - Current Posts</h2>
                <div class="sidebar-content">
                {% for topic in currenttopics %}
                <div class="topic-title"><a href="/topic?topic={{ topic.key }}">{{ topic.title }}</a><span class="topic-nickname"> {{ topic.nickname }} </span>  <span class="topic-commentcount">({{ topic.commentcount }} replies)</span></div>
                {% endfor %}
                </div>
            </div>
            {% endif %}

        </div>

    </div>

<div id="footer">
        <ul id="footer-navigation">
            <li class='first' ><a href="/about">About</a></li>
            <li><a href="/about#contact">Contact</a></li>
            <li><a href="/rss">RSS</a></li>
        </ul>
      </div>


</div>
</body>
</html>


